/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package module4.exercise1;

/**
 *
 * @author trang
 */
public class FooBizBaz {
    public static void main(String[] args) {

        for (int num = 1; num < 51; num++) {
//      print number from 1 to 50 by using print() Method
           // System.out.print("\nThe " + num + " number is: " + num);

//      print number from 1 to 50 by using println() Method

            if ((num%3==0) && (num%5==0)) {
                System.out.println(num + " foo biz");
            }
            else if (num%3==0) {
                System.out.println(num + "foo");
            } else if (num%5==0) {
                System.out.println(num + " biz");
            } else if (num%7==0) {
                System.out.println(num + " baz");
            } else {
                System.out.println(num);
            }
        }
    }
}

